package utils;

import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;

public class Filter {
	
	private Collection<String> notAllowedContent;
	
	public Filter(){
		
		this.notAllowedContent = new LinkedList<String>();
		this.notAllowedContent.add(".js");
		this.notAllowedContent.add(".jpg");
		this.notAllowedContent.add(".gif");
		this.notAllowedContent.add(".css");
		this.notAllowedContent.add(".ico");
		this.notAllowedContent.add(".png");
		this.notAllowedContent.add("json");
		this.notAllowedContent.add(".asp");
		this.notAllowedContent.add(".svg");
		this.notAllowedContent.add(".bs");
		this.notAllowedContent.add("googleads");
		this.notAllowedContent.add("callback");
		
	}
	
	public boolean filterContent(String url){
		
		boolean filter = true;
		String tmp;
		Iterator<String> iterator = this.notAllowedContent.iterator();
		while(iterator.hasNext()&&filter){
			tmp = iterator.next();
			if(url.contains(tmp))
				filter = false;
		}
		return filter;
		
	}

}
